package com.itheima.mapper;

import com.itheima.pojo.Emp;
import org.apache.ibatis.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Mapper
public interface EmpMapper {
    @Select("select * from emp") //查询
    public List<Emp> empAll();
    //插入
    @Insert("insert into emp(id, username, password, name, gender, phone, job, salary, image, entry_date, create_time, update_time) VALUES (null,#{username},#{password},#{name},#{gender},#{phone},#{job},#{salary},#{image},#{entry_date},#{create_time},#{update_time} )")
    public int save(Emp emp);
//    @Delete("delete from emp where id=#{id}")
    public int deleteById(Integer id);
//    @Update("update emp set username=#{username} ,password=#{password},name=#{name},phone=#{phone} where id=#{id}")
    public int updateName(Emp emp);
}
